﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Lincolnwood.Foundation.Common.Data;

namespace Lincolnwood.Foundation.SermonLibrary
{
    [Serializable]
    public class SermonSeries : AuditableEntity<Guid>
    {
        private string _name;
        private string _description;
        private Iesi.Collections.Generic.ISet<Sermon> _sermons = new Iesi.Collections.Generic.SortedSet<Sermon>();

        internal SermonSeries()
        {

        }

        public SermonSeries(string name) : this(name, string.Empty)
        {

        }

        public SermonSeries(string name, string description)
        {
            _name = name;
            _description = description;
        }

        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }

        public string Description
        {
            get { return _description; }
            set { _description = value; }
        }

        public Iesi.Collections.Generic.ISet<Sermon> Sermons
        {
            get { return _sermons; }
        }

        public override bool Equals(object obj)
        {
            var testSeries = obj as SermonSeries;
            if (testSeries == null)
                return false;
            else
                return Equals(testSeries);
        }

        private bool Equals(SermonSeries arg)
        {
            if (this == arg)
                return true;

            return
            Name.Equals(arg.Name) &&
            Description.Equals(arg.Description);
        }

    }
}